Shrink shadow extents
authorAlexander Mikhaylenko <alexm@gnome.org>
Wed, 4 Aug 2021 09:24:35 +0000 (14:24 +0500)
committerAlexander Mikhaylenko <alexm@gnome.org>
Wed, 4 Aug 2021 09:47:17 +0000 (14:47 +0500)
commit46a9538b6a8b866d07e63c2ecf28c2046196f53b
treea732c16293c1e4bd1bb126d2a20ecbfd367854e0
parentcc6ecc8b623a776e4c5e5c8001a02cf92ed5c5d9
Shrink shadow extents

Long time ago, Cairo shadows in both GTK3 and 4 were drawn at a size about
twice their radius. Eventually this was fixed but the shadow extents are
still calculated for the previous size and appear unreasonably large: for
example, 141px for a 50px radius shadow. This can get very noticeable in
places such as invisible window frame which gets included into screenshots.

https://gitlab.gnome.org/GNOME/gtk/-/merge_requests/3419 just divides the
radius by 2 when drawing a shadow with Cairo, do the same when calculating
extents.

See https://gitlab.gnome.org/GNOME/gtk/-/issues/3841
gsk/gskrendernodeimpl.c
gtk/gtkcssshadowvalue.c